<template>
  <div id="app">
    <router-view/>
  </div>
</template>
<script>
export default {
  created(){
    window.addEventListener("beforeunload",()=>{
      localStorage.setItem("userStore",JSON.stringify(this.$store.state))
    })
    localStorage.getItem("userStore") && this.$store.replaceState(Object.assign(this.$store.state,JSON.parse(localStorage.getItem("userStore"))));
  }
}
</script>
<style lang="less">

</style>
